﻿<!--
  
   RaceEditor.xaml
  
   Copyright (c) 2007 Mike Strobel
  
   This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
   For details, see <http://www.opensource.org/licenses/ms-rl.html>.
  
   All other rights reserved.
  
  -->
<UserControl x:Class="SupremacyEditor.RacesModule.RaceEditor"
             xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
             xmlns:local="clr-namespace:SupremacyEditor"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:apshared="http://schemas.actiprosoftware.com/winfx/xaml/shared">

  <Grid Margin="11">
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto"
                        SharedSizeGroup="EditorLeftColumnGroup" />
      <ColumnDefinition MaxWidth="480"
                        Width="*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <apshared:PixelSnapper Grid.Column="0"
                           Grid.Row="0"
                           Margin="0,0,2,0">
      <Label Target="{Binding ElementName=IdentityText}"
             Content="Identity:"
             FontWeight="Bold" />
    </apshared:PixelSnapper>
    <TextBox x:Name="IdentityText"
             Grid.Column="1"
             Grid.Row="0"
             Margin="2,3,2,3"
             MinWidth="128"
             MaxWidth="256"
             HorizontalAlignment="Left"
             CharacterCasing="Upper">
      <TextBox.Text>
        <Binding Path="Key"
                 Mode="TwoWay">
          <Binding.ValidationRules>
            <local:NonEmptyValidationRule />
          </Binding.ValidationRules>
        </Binding>
      </TextBox.Text>
    </TextBox>

    <apshared:PixelSnapper Grid.Column="0"
                           Grid.Row="1"
                           Margin="0,0,2,0">
      <Label Target="{Binding ElementName=SingularNameText}"
             Content="Singular Name:"
             FontWeight="Bold" />
    </apshared:PixelSnapper>
    <local:LocalizedTextEditor Grid.Column="1"
                                   Grid.Row="1"
                                   Margin="2,3,2,3"
                                   MinWidth="128"
                                   MaxWidth="256"
                                   HorizontalAlignment="Left"
                                   PropertyName="SingularName"
                                   DataContext="{Binding Path=Text}" />
<!--
        <TextBox Name="SingularNameText"
             Grid.Column="1"
             Grid.Row="1"
             Margin="2,3,2,3"
             MinWidth="128"
             MaxWidth="256"
             HorizontalAlignment="Left">
      <TextBox.Text>
        <Binding Path="Text.SingularName"
                 Mode="TwoWay">
          <Binding.ValidationRules>
            <local:NonEmptyValidationRule />
          </Binding.ValidationRules>
        </Binding>
      </TextBox.Text>
    </TextBox>
-->

    <apshared:PixelSnapper Grid.Column="0"
                           Grid.Row="2"
                           Margin="0,0,2,0">
      <Label Target="{Binding ElementName=PluralNameText}"
             Content="Plural Name:"
             FontWeight="Bold" />
    </apshared:PixelSnapper>
    <local:LocalizedTextEditor Grid.Column="1"
                               Grid.Row="2"
                               Margin="2,3,2,3"
                               MinWidth="128"
                               MaxWidth="256"
                               HorizontalAlignment="Left"
                               PropertyName="PluralName"
                               DataContext="{Binding Path=Text}" />
<!--
    <TextBox Name="PluralNameText"
             Grid.Column="1"
             Grid.Row="2"
             Margin="2,3,2,3"
             MinWidth="128"
             MaxWidth="512"
             HorizontalAlignment="Left">
      <TextBox.Text>
        <Binding Path="Text.PluralName"
                 Mode="TwoWay">
          <Binding.ValidationRules>
            <local:NonEmptyValidationRule />
          </Binding.ValidationRules>
        </Binding>
      </TextBox.Text>
    </TextBox>
-->
    <apshared:PixelSnapper Grid.Column="0"
                           Grid.Row="3"
                           Margin="0,0,2,0">
      <Label Target="{Binding ElementName=DescriptionText}"
             Content="Description:"
             FontWeight="Bold" />
    </apshared:PixelSnapper>
    <local:LocalizedTextEditor Grid.Column="1"
                               Grid.Row="3"
                               Margin="2,3,2,3"
                               MinWidth="128"
                               Height="128"
                               AcceptsReturn="True"
                               TextWrapping="Wrap"
                               VerticalScrollBarVisibility="Visible"
                               PropertyName="Description"
                               SpellCheck.IsEnabled="True"
                               DataContext="{Binding Path=Text}" />
<!--
    <TextBox Name="DescriptionText"
             Grid.Column="1"
             Grid.Row="3"
             Height="128"
             Margin="2,3,2,3"
             TextWrapping="Wrap"
             VerticalScrollBarVisibility="Visible"
             AcceptsReturn="True"
             Text="{Binding Path=Text.Description, Mode=TwoWay}" />
-->

    <apshared:PixelSnapper Grid.Column="0"
                           Grid.Row="4"
                           Margin="0,0,2,0">
      <Label Target="{Binding ElementName=HomePlanetTypeList}"
             Content="Homeworld Type:"
             FontWeight="Bold" />
    </apshared:PixelSnapper>
    <ComboBox Name="HomePlanetTypeList"
              Grid.Column="1"
              Grid.Row="4"
              Margin="2,3,2,3"
              MinWidth="128"
              HorizontalAlignment="Left"
              SelectedItem="{Binding Path=HomePlanetType, Mode=TwoWay}" />

  </Grid>

</UserControl>